package com.situ.mall.web.service;

import com.mall.common.util.JsonResult;
import com.mall.user.model.dto.user.UserLoginRequest;
import com.mall.user.model.dto.user.UserRegisterRequest;
import com.mall.user.model.dto.user.UserUpdateMyRequest;
import com.mall.user.model.dto.user.UserPasswordUpdateRequest;
import com.mall.user.model.vo.LoginUserVO;
import com.mall.user.model.vo.UserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 用户服务 Feign 客户端
 */
@FeignClient(name = "user-api", path = "/user", contextId = "user-api")
public interface UserFeignService {

    /**
     * 用户登录
     */
    @PostMapping("/login")
    JsonResult<LoginUserVO> userLogin(@RequestBody UserLoginRequest userLoginRequest);

    /**
     * 用户注册
     */
    @PostMapping("/register")
    JsonResult<Long> userRegister(@RequestBody UserRegisterRequest userRegisterRequest);

    /**
     * 获取当前登录用户信息
     */
    @GetMapping("/get/login")
    JsonResult<LoginUserVO> getLoginUser();

    /**
     * 根据ID获取用户信息
     */
    @GetMapping("/get/{id}")
    JsonResult<UserVO> getUserById(@PathVariable("id") Long id);

    /**
     * 用户注销
     */
    @PostMapping("/logout")
    JsonResult<Boolean> userLogout();

    /**
     * 更新个人信息
     */
    @PostMapping("/update/my")
    JsonResult<Boolean> updateMyUser(@RequestBody UserUpdateMyRequest userUpdateMyRequest);

    /**
     * 修改密码
     */
    @PostMapping("/update/password")
    JsonResult<Boolean> updatePassword(@RequestBody UserPasswordUpdateRequest passwordUpdateRequest);
} 